import { defineStore } from "pinia";
export const useMyStore = defineStore("defineStore", {
  state: () => {
    return {
      pageIndex: 0,
      count: 0,

      swiper: null,
      customArtwork: {
        pageName: "",
        pageContent: [],
      },
      showComponentEdit: {
        image: false,
        video: false,
        text: false,
        btn: false,
      },
    };
  },
  actions: {
    closeEditing() {
      console.log(this.showComponentEdit, "this.showComponentEdit");
      Object.keys(this.showComponentEdit).forEach(
        (v) => (this.showComponentEdit[v] = false)
      );
    },
    setPageIndex(index) {
      this.pageIndex = index;
    },
    setSwiper(e) {
      this.swiper = e;
    },
  },
});
